<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="styles/style.css">
        <link rel="stylesheet" href="styles/theme/atom-one-dark.css">
        <title>例子52-ES6/7常用语法介绍</title>
    </head>

    <body>
        <pre>
            <code>
                // 例子52

                async function getTitle(url) {
                    let response = await fetch(url);
                    let html = await response.text();
                    return html.match(/&lt;title&gt;([\s\S]+)<\/title>/i)[1];
                }
                getTitle('https://tc39.github.io/ecma262/').then(console.log) // ECMAScript® 2019 Language & nbsp;Specification
            </code>
        </pre>
        <script src="scripts/libs/highlight.pack.js"></script>
        <script src="scripts/52.js"></script>
        <script>
            hljs.initHighlightingOnLoad();
        </script>
    </body>

</html>